(function(doc, win){
    var $img = $('.scroller img');
    if($img.length===1) {
        $('.box_indicator').hide();
    }
    function initPicsScroll() {
        var w = $('#box_pics .scroller img').length;
        $('#box_pics .scroller').css({width: w * 7.50 +'rem'});
        $('#box_pics_indicator').css({width: w * 0.28 + 'rem'});
        for(var i = 0; i < w; i++) {
            $('#box_pics_indicator').append('<div class="dotty-bg"><div class="dotty"></div></div>');
        }
        var myScroll = new IScroll('#box_pics', {
            scrollX: true,
            scrollY: false,
            momentum: false,
            snap: true,
            snapSpeed: 400,
            keyBindings: true,
            indicators: {
                el: document.getElementById('box_pics_indicator'),
                resize: false
            }
        });
    }

    doc.addEventListener('DOMContentLoaded', initPicsScroll, false);
})(document, window);